import type { DrawingType } from "@@/utils/CustomCesium/CustomCesium"
import type { Cartesian3 } from "cesium"
import type { ResponseTableData } from "../common"
import type { SevenCode } from "../entity/type"

// 环境设置
export interface IEnvItem {
  // 想定id
  scnId: string
  // 环境对象id
  id: string
  // 环境对象名称
  envObjName: string
  // 海况等级(0-9)
  seaStateLevel: number
  // 风向
  windCou: number
  // 风速
  windVel: number
}

// 阵营
export interface ICampItem {
  id: string
  label: string
  value: string
  color: string
}

// 实体对象
export interface IEntityObject {
  id: string
  identify: string
  assistIdentify: string
  entityType: SevenCode
  entityPath: string
  [propName: string]: any
}

export interface IEntityObjectBasicInfo {
  // 实体名称
  entityName: string
  // 模型管理实体id
  entityId: string
  // 所属方
  side: string
  // 所属方值
  sideColor: string
  // 经度
  longitude?: number
  // 纬度
  latitude?: number
  // 高度
  height?: number
  // 实体类型
  entityType: string
}

// 控制对象
export interface IControlItem {
  // id
  id: string
  // 想定id
  scnId: string
  // 控制对象名称
  name: string
  // 所属方
  side: string
  // 所属方颜色
  sideColor: string
  // 类型
  type: DrawingType
  // 点
  path: string
  // 坐标
  positions: Position[]
  // 其他参数
  [propName: string]: any
}

// 实例对象信息
export interface IEntityDetail {
  // 实例id
  id: string
  scnId: string
  basicInfo: IEntityObjectBasicInfo
  entityTypeObj: SevenCode
  extended?: string
}

// 已选控制对象
export interface IControlInstance extends IControlItem {
  cesiumId?: string
  cesiumPosition?: Cartesian3 | Cartesian3[]
}

// 已选实例对象
export interface IEntityInstance extends IEntityDetail {
  cesiumId?: string
  cesiumPosition?: Cartesian3 | Cartesian3[]
}

export interface UploadScnInfo {
  scnName: string
  description?: string
  pId?: string
  engineId?: string
  file?: File
  fileName: string
}

export interface TableRequestData {
  /** 模糊搜索内容 */
  searchKey?: string
  /** 项目名称 */
  pId?: string
  current: number
  pageSize: number
}

export interface Position {
  longitude: number
  latitude: number
  height: number
}

export interface ScnBaseInfo {
  id?: string
  scnName: string
  description?: string
  scnStartTime: string
  scnEndTime: string
  scnRunN: number
  simAreaRange: Position[]
  useRandomSeed: boolean
  randomSeed: number
  tTime?: number
  simNetworkComm: boolean
  pId?: string
  engineId?: string
  imageFile?: string
  timeRange?: string[]
}

export interface ScnBaseViewInfo extends ScnBaseInfo {

}

export interface ScnTableInfo extends ScnBaseInfo {
  id: string
  createUser: string
  createTime: string
  description: string
}
export interface PageTableRequestData extends TableRequestData {}
export type SearchTableResponseData = ApiResponseData<ResponseTableData<ScnTableInfo>>
export type BaseViewResponseData = ApiResponseData<ScnBaseViewInfo>
